package com.mars.push.core.channel.apns;

import com.mars.push.api.common.MessageInput;
import com.mars.push.api.dto.PushMessageInput;
import com.mars.push.core.channel.AbstractPushChannel;
import com.mars.push.core.channel.PushMessage;
import com.mars.push.core.channel.apns.dto.ApnsPushMessage;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author King
 * @create 2020/7/10 15:05
 */
public class ApnsChannel extends AbstractPushChannel {

    @Autowired
    private ApnsPushServer apnsPushServer;

    @Override
    protected Object iosPush0(PushMessage pushMessage) {
        ApnsPushMessage apnsPushMessage = new ApnsPushMessage();
        apnsPushServer.push(apnsPushMessage);
        return "success";
    }

    @Override
    public PushMessage createMessage(MessageInput input) {
        ApnsPushMessage apnsPushMessage = new ApnsPushMessage();
        PushMessageInput source = (PushMessageInput) input;
        return apnsPushMessage;
    }

    @Override
    protected void onSuccess(PushMessage message, Object result) {

    }

    @Override
    protected void onFail(PushMessage message, Object result) {

    }

    @Override
    protected void onException(PushMessage message, Object result) {

    }

    @Override
    protected Object androidPush0(PushMessage pushMessage) {
        return null;
    }

    @Override
    protected Object allPush0(PushMessage pushMessage) {
        return null;
    }

}
